//
// Created by xsh on 2025/5/30.
//

#ifndef SINSYNTH_H
#define SINSYNTH_H
#include "../../../../app/src/main/jni/include/instrument.h"
#include <jni.h>
class SinSynth: public Instrument {
public:
    SinSynth();
    ~SinSynth();
    // 实现接口方法
    double genWave(short* buffer, int numSamples, double phase, double sampleRate) override;
    void onEvent(const char* eventName, jobject value, JNIEnv* env) override;
    double frequency = 261.63; //默认c4
    double amp = 0.5;
};
// 导出函数
extern "C" SinSynth* createInstrument();
extern "C" void destroyInstrument(Instrument* inst);
#endif